import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../views/Layout/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: Layout,
      redirect: '/enterprise',
      children: [
        {
          path: '/enterprise',
          component: () => import('../views/enterprise/index.vue'),
          meta: {
            title: '企业管理',
          },
        },
        {
          path: '/user',
          component: () => import('../views/user/index.vue'),
          meta: {
            title: '用户管理',
          },
        },
      ],
    },
  ],
})

export default router
